package com.acwing.partition4;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @author `RKC`
 * @date 2021/11/30 19:22
 */
public class AC338计数问题 {

    private static final int N = 11;
    //dp[i][j][k]表示最高位是i，长度为j的数里面包含k的个数
    private static int[][][] dp = new int[10][N][10];

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        init();
        while (true) {
            String[] s = reader.readLine().split("\\s+");
            int x = Integer.parseInt(s[0]), y = Integer.parseInt(s[1]);
            if (x == 0 && y == 0) break;
            if (y < x) {
                x = x ^ y;
                y = x ^ y;
                x = x ^ y;
            }
            for (int i = 0; i <= 9; i++) writer.write((resolve(y, i) - resolve(x - 1, i)) + " ");
            writer.write("\n");
        }
        writer.flush();
    }

    private static void init() {
        //初始化最高位是i，长度是1的数里面只能包含i的个数是1
        for (int i = 0; i <= 9; i++) dp[i][1][i] = 1;
        //对于dp[i][j][k]的状态，转移自低一个长度的dp[i][j-1][k]，此时直接取幂即可；还可以来自于以其它数位开头，但是长度为j-1的dp[m][j-1][k]
        for (int length = 2; length < N; length++) {
            for (int i = 0; i <= 9; i++) {
                for (int k = 0; k <= 9; k++) {
                    if (k == i) dp[i][length][k] += Math.pow(10, length - 1);
                    for (int j = 0; j <= 9; j++) {
                        dp[i][length][k] += dp[j][length - 1][k];
                    }
                }
            }
        }
    }

    private static int resolve(int num, int u) {
        List<Integer> nums = new ArrayList<>();
        while (num != 0) {
            nums.add(num % 10);
            num /= 10;
        }
        int answer = 0, last = 0;
        //num=333 u=3
        for (int i = nums.size() - 1; i >= 0; i--) {
            int x = nums.get(i);
            //第一位是不考虑0开始，下标从1开始累加f(1,3,3)+f(2,3,3)，计算了100-299之间的3的个数，last为1，表示到目前为止前面有3的数量
            //第二位开始考虑0开始，累加f(0,2,3)+f(1,2,3)+f(2,2,3)+3*1*10^1，计算了00-29和30-39中3的个数，last为2
            //最后一位f(0,1,3)+f(1,1,3)+f(2,1,3)+3*2*10^0，最后需要加上333本身有的3个3
            for (int j = i == nums.size() - 1 ? 1 : 0; j < x; j++) {
                answer += dp[j][i + 1][u];
            }
            //以当前位为高位计算包含u的数量，同时要考虑目前为止有多少个x
            answer += x * Math.pow(10, i) * last;
            if (x == u) last++;
            //遍历到了最后，加上这单个数本身含有的u的个数
            if (i == 0) answer += last;
        }
        //对前导零的情况进行特殊处理
        for (int length = 1; length < nums.size(); length++) {
            for (int i = 1; i <= 9; i++) {
                answer += dp[i][length][u];
            }
        }
        return answer;
    }
}
